package com.qzimp.fujiancuo.service.impl;

import com.mybatisflex.spring.service.impl.ServiceImpl;
import com.qzimp.fujiancuo.entity.Cuo;
import com.qzimp.fujiancuo.entity.dto.CuoDetailsDto;
import com.qzimp.fujiancuo.entity.dto.CuoEventDTO;
import com.qzimp.fujiancuo.mapper.CuoMapper;
import com.qzimp.fujiancuo.service.CuoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 *  服务层实现。
 *
 * @author 吴宗波
 * @since 2024-11-21
 */
@Service
public class CuoServiceImpl extends ServiceImpl<CuoMapper, Cuo> implements CuoService {
    @Autowired
    private CuoMapper cuoMapper;

    /*根据厝id查询厝的所有事件*/
    @Override
    public CuoEventDTO getCuoEventId(Integer id) {
        return cuoMapper.getCuoEventId(id);
    }
    @Override
    public CuoDetailsDto getCuoDetailsByCuoId(Integer cuoId) {
        return cuoMapper.getCuoDetailsByCuoId(cuoId);
    }
    @Override
    public int insertCuo(Cuo cuo) {
        return cuoMapper.insert(cuo);
    }
}
